<template>
  <div class="overview">
    <div class="content">
      <div class="one">至今已有<span id="thumbUpNum">{{thumbUpNum}}</span>个人</div>
      <div class="two">在牛人牛股称赞了我</div>
    </div>
  </div>
</template>

<script>
  import LocalDAO from 'common/localDAO'
  import RemoteDAO from 'common/remoteDAO'
  export default {
    data () {
      return {
        userCode: LocalDAO.getUserCode(),
        thumbUpNum: 0
      }
    },
    created () {
      this.getData();
    },
    methods: {
      getData () {
        let args = {};
        args.USER_CODE = this.userCode;
        args.COMMUNITY_STATUS = "1";
        args.COMMUNITY_TYPE = "2";
        // 查询点赞我的人数
        RemoteDAO.callUC12008314(args, response => {
          if (response.error == "0") {
            if (response.data.body.length > 0) {
              const thumbUpNum = response.data.body[0].GOODPOINT_COUNT;
              this.thumbUpNum = thumbUpNum;
              LocalDAO.setThumbUpNum(thumbUpNum);
              // 更新分享页数据
              let shareAdmirers = LocalDAO.getShareAdmirers();
              shareAdmirers.overview.thumbUpNum = thumbUpNum;
              LocalDAO.setShareAdmirers(shareAdmirers);
            }
          }else{
            this.$store.dispatch('setTip',{text:response.data})
          }
        })
      }
    }
  }
</script>
